package com.whfc.common.idcard;

import com.whfc.common.util.DateUtil;

import java.util.Date;

/**
 * @Description 身份证处理类
 * @Author hw
 * @Date 2021-09-08 10:55
 * @Version 1.0
 */
public class IDCardUtil {


    /**
     * 获取身份证号生日
     * @param idCard
     * @return
     */
    public static Date getBirth(String idCard) {
        String birth = idCard.substring(6, 10) + "-" + idCard.substring(10, 12) + "-" + idCard.substring(12, 14);
        return DateUtil.parseDate(birth, DateUtil.DATE_FORMAT);
    }

}
